package address

import (
	"gitee.com/xgotool/backend-framework-template/model"
	"gitee.com/xgotool/backend-framework-template/service/address"
	"gitee.com/xiaoyutab/xgotool/individual/xginplus"
)

// 创建/修改地址接口
//
//	POST	user/address/create
func Create(c *xginplus.Context) *xginplus.Response {
	mod := model.Address{}
	err := c.RBind(&mod)
	if err != nil {
		return c.Error(err)
	}
	mod.Uid = c.GetUint("uid")
	err = address.Create(&mod)
	if err != nil {
		return c.Error(err)
	}
	return c.SuccessEmpty()
}
